package common

import "strings"

type ParseActor struct {
	Service   string
	ActorType string
	IsService bool
}

func Adapt(str string) ParseActor {
	arr := strings.Split(str, ".")
	return ParseActor{
		Service: arr[0],
		ActorType: func() string {
			if len(arr) > 1 {
				return arr[1]
			}
			return arr[0]
		}(),
		IsService: IfGet(len(arr) > 1, false, true).(bool),
	}
}
